/**
 *
 * Copyright 2012 TeleNav, Inc. All rights reserved.
 * MainScreen.java
 *
 */
package com.weibo.entry;

import com.weibo.net.ShareActivity;
import com.weibo.net.Weibo;
import com.weibo.net.WeiboException;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 *@author yhzhou
 *@date 2012-6-11
 */
public class MainScreen extends Activity
{
    
    private Button shareButton;
    private Button surfButton;
    private Button commentButon;
    private Button atButton;
    
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        shareButton = (Button) findViewById(R.id.share_button);
        shareButton.setOnClickListener(new OnClickListener()
        {
            
            @Override
            public void onClick(View v)
            {
                 Weibo weibo = Weibo.getInstance();
                 try
                {
                    weibo.share2weibo(MainScreen.this, weibo.getAccessToken().getToken(), weibo.getAccessToken().getSecret(), " ", "");
                    Intent i = new Intent(MainScreen.this, ShareActivity.class);
                    MainScreen.this.startActivity(i);
                }
                catch (WeiboException e)
                {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        });
    }
    
}
